package main

import (
	"github.com/astaxie/beego"
	"github.com/robfig/cron"
	"nspel/nspel"
	"nspel/report"
	"nspel/routers"
)

func main() {
	beego.BConfig.WebConfig.Session.SessionOn = true
	beego.LoadAppConfig("json", "config/nspel.json")
	nspel.LoggerInit("config/logger.json")
	nspel.OrmEngineInit("config/ormengine.json")
	nspel.DataSourceInit("config/datasource.json")
	routers.RoutersInit()
	c := cron.New()
	err := c.AddFunc(nspel.Corn, report.ReportTask)
	if err != nil {
		panic(err)
	}
	c.Start()
	//report.ReportTask()
	beego.Run()
}
